package mviewer.types;

public class TexturedPolygon3d extends Polygon3d implements ITexturedPolygon {

	private int[] textureCoordinateIndices;
	private TextureCoordinate[] textureCoordinates;

	public TexturedPolygon3d(int[] vertexIndices, IVertex[] vertices,
			IVector normal, Material material, int[] textureCoordinateIndices,
			TextureCoordinate[] textureCoordinates) {
		super(vertexIndices, vertices, normal, material);
		this.textureCoordinateIndices = textureCoordinateIndices;
		this.textureCoordinates = textureCoordinates;

		if (textureCoordinates.length != vertices.length)
			throw new IllegalArgumentException("TextureCoordinate[]'s length differs from IVertex[]'s length");
	}

	public int[] getTextureCoordinateIndices() {
		return textureCoordinateIndices;
	}

	public TextureCoordinate[] getTextureCoordinates() {
		return textureCoordinates;
	}

	@Override
	public ITexturedPolygon getTexturedPolygon() {
		return this;
	}
}
